﻿<Window x:Class="Lesson6.Window3"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Lesson6" 
    Title="Lesson6" Height="300" Width="300"
    >
  <Window.CommandBindings>
    <CommandBinding 
      Command="local:MyCommands.InsertCustomer" 
      CanExecute="InsertCustomer_CanExecute" 
      Executed="InsertCustomer_Executed" />
  </Window.CommandBindings>


  <StackPanel>
  <Menu>
    <MenuItem Command="ApplicationCommands.Delete"         
      Header="Delete" />
    <MenuItem 
  Command="local:MyCommands.InsertCustomer" 
  Header="Insert Customer" />
  </Menu>
    

  <Label>Khách hàng:</Label>

  <ListBox Name="lsbCustomers">
    <ListBox.CommandBindings>
      <CommandBinding 
        Command="ApplicationCommands.Delete" 
        CanExecute="DeleteCustomer_CanExecute" 
        Executed="DeleteCustomer_Executed" />
    </ListBox.CommandBindings>
    

    <ListBoxItem>Bùi Như Lạc</ListBoxItem>
    <ListBoxItem>Ngô Giang Thơm</ListBoxItem>
    <ListBoxItem>Nguyễn Y Vân</ListBoxItem>    
  </ListBox>

    <Label>Sản phẩm:</Label>

    <ListBox x:Name="lsbProducts" >
      <ListBox.CommandBindings>
        <CommandBinding 

          Command="ApplicationCommands.Delete" 
          CanExecute="DeleteProduct_CanExecute" 
          Executed="DeleteProduct_Executed" />
      </ListBox.CommandBindings>
      <ListBoxItem>Nếu còn có ngày mai</ListBoxItem>
      <ListBoxItem>Chiếc lá rơi màu xanh</ListBoxItem>
      <ListBoxItem>Nhân gian chi ngộ</ListBoxItem>
    </ListBox>

    
  </StackPanel>
</Window>
